EMT Practice Test

1. Question Content...


Question List

Question1: What is a potential design issue with the following code?

Question2: When calling a RESTful web service, a developer receives a JSON payload that has a data hierarchy that is nested three levels deep. How can the developer describe the external data?

Question3: A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex.
How can the developer meet these requirements? (Choose two.)

Question4: Which three actions must be completed in a Lightning web component for a JavaScript file in a static resource to be loaded?
Choose 3 answers

Question5: A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created.
Which consideration should be checked to resolve the issue?

Question6: A Lightning web component exists in the system and displays information about the record in context as a modal. Salesforce administrators need to use this component within the Lightning App Builder.
Which two settings should the developer configure within the xml resource file?
Choose 2 answers

Question7: Universal Containers needs to integrate with a Heroku service that resizes product images submitted by users.
What are two alternatives to implement the integration and protect against malicious calls to Heroku app's endpoint? Choose 2 answers

Question8: Which use case can only be performed by using asynchronous Apex?

Question9: A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup.
What are three actions to enable this functionality? (Choose three.)

Question10: Universal Containers has an existing automation where a custom record called Account Plan is created upon an Account being marked as a Customer. Recently, a Workflow Rule was added so that whenever an Account is marked as a Customer, a 'Customer Since' date field is updated with today's date.
Now, since the addition of the Workflow Rule, two Account Plan records are created whenever the Account is marked as a Customer.
What might cause this to happen?

Question11: Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs. What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component?

Question12: Which annotation exposes an Apex class as a RESTful neb service?

Question13: REST uses___________.

Question14: A company wants to create a dynamic survey that navigates users through a different series of questions based on their previous responses.
What is the recommended solution to meet this requirement?

Question15: A developer wrote a test class that successfully asserts a trigger on Account. It fires and updates data correctly in a sandbox environment.
A salesforce admin with a custom profile attempts to deploy this trigger via a change set into the production environment, but the test class fails with an insufficient privileges error.
What should a developer do to fix the problem?

Question16: A developer wants to use an Aura Component with a Custom Action.
What should be considered in order to do this?

Question17: Employee_c is a Child object of Company_c. The Company_c object has an external Id field Company_ld_c.
How can a developer insert an Employee_c record linked to Company_c with a Company_ld_c of '999'?

Question18: What is the transaction limit on the number of callouts?

Question19: A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunity owned by the currently logged-in user.
When the component is rendered, the following message is displayed: ''Error retrieving data'' Which modification should be implemented to the Apex class to overcome the issue?

Question20:
A company has the Lightning Component above that allows users to dick a button to save their changes and redirects them to a different page. Currently, when the user hits the Save button the records are getting saved, but they are not redirected.
Which three techniques can a developer use to debug the JavaScript? Choose 3 answers

Question21: What is the transaction limit on the max Salesforce CPU time?

Question22: A company has a custom object. Request__c. that has a field, Completed__c. and a Lookup to Opportunity, Opportunity__c.
Which SOQL query will get a unique list of all of the Opportunity records that have a Completed Request?

Question23: A developer writes the following code:

While testing the code, the developer receives the following error message: System.CalloutException : You have uncommitted work pending What should the developer do? (Choose two.)

Question24: How should a developer verify that a specific Account record is being tested in a test class for a visualforce controller?

Question25: How can a developer efficiently incorporate multiple JavaScript libraries, such as JQuery and MomenUS, in a Lightning Component?

Question26: A developer needs to create a service that will process an email sent to it and create an account and contact using the contents of the email as data for the records.
How might a developer accomplish this requirement?

Question27: Which interface needs to be implemented by a Lightning Component so that it may be displayed in modal dialog by clicking a button on a Lightning Record page?

Question28: What level can a hierarchy custom setting be defined for? (Choose three.)

Question29:
The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Account are simultaneously updated to be customer.
The test method fails at the Line 20 because of too many SOQL queries
What is the correct way to fix this?

The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.
The test method fails at the Line 20 because of too many SOQL queries.
What is the correct way to fix this?

Question30: A company wants to build a custom Lightning Component that will display a specified Account Field Set and that can only be added to the Account record page. Which design resource configuration should be used?

Question31: A developer is working on code that requires a call to an external web service from a batch. How should the developer enable this functionality?

Question32: An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved.
What is the optimal way to implement this?

Question33: A company wants to implement a new call center process for handling customer service calls. It requires service reps to ask for the caller's account number before proceeding with the rest of their call script.
Following best practices, what should a developer use to meet this requirement?

Question34: A developer Is asked to develop a new AppExthange application. A feature of the program creates Survey records when a Case reaches a certain stage and Is of a certain Record Type. This feature needs to be configurable, as different Salesforce instances require Surveys at different times. Additionally, the out-of-the-box AppExchange app needs to come with a set of best practice settings that apply to most customers.
What should the developer use to store and package the custom configuration settings for the app?

Question35: A developer needs to create a Lightning page for entering Order Information. An error message should be displayed if the zip code entered as part of the Order's shipping address is not numeric.
What is a recommended way for the error message be displayed to the end user?

Question36: A developer wants to retrieve and deploy metadata, perform simple CSV export of query results, and debug Apex REST calls by viewing JSON responses.
Which tool should the developer use?

Question37: A lead developer for a Salesforce organization needs to develop a page-centric application that allows the user to interact with multiple objects related to a Contact The application needs to implement a third-party JavaScript framework such as Angular, and must be made available in both Classic and Lightning Experience.
Given these requirements, what is the recommended solution to develop the application?

Question38: A developer created three Rollup Summary fields: Total_timesheets_c, Total_Approved_timesheet_c and Total_project_Timesheet_c in the custom object, project _c Now, the developer is tasked with created a new field to show the ratio between and approved

Question39: Choose the correct definition for <apex:actionFunction>.

Question40: Which statement is true regarding both Flow and Lightning Process? (Choose two.)

Question41: A company's support process dictates that any time a Case is closed with a Status of 'Could not fix,' an Engineering Review custom object record should be created and populated with information from the Case, the Contact, and any of the Products associated with the Case. What is the correct way to automate this using an Apex trigger?

Question42: What is the transaction limit on the number of "sendEmail" method calls?

Question43: An integration user makes a successful login() call via the SOAP API.
What can be used in the SOAP header to provide server authorization for subsequent API requests?

Question44: An environment has two Apex Triggers: an after-update trigger on Account and an after-update trigger on Contact. The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state.
Consider the following: A mass update of 200 Account records' addresses, where each Account has 50 Contacts. Each Contact has 1 Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.
What will happen when the mass update occurs?

Question45: A company has a custom object Sales_Help_Request__c that has a Lookup relationship to Opportunity. The Sales_Help_Request__c has a number field, Number_of_Hours__c, that represents the amount of time spent on the Sales_Help_Request__c.
A developer is tasked with creating a field, Total_Hours__c, on Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity.
What should the developer use to implement this?

Question46: An org has a requirement that the Shipping Address on the Account must be validated by a third-party web service, before the Account is allowed to be inserted.
What is the optimal way to meet this requirement?

Question47: A developer built a Component to be used at the front desk for guests to self-register upon arrival at a kiosk.
The developer is now asked to create a Component for the Utility Tray to alert Users whenever a guest has arrived at the front desk. What should be used?

Question48: A developer has written the following method:
static void processList(List<sobject> input){
Which code block can be used to call the method?

Question49: In a VisualForce page with a VisualForce component that has rendered set to false when the page loads, how can a developer ensure it will show on a re-render?

Question50: A developer has a page with two extensions overriding the Standard controller for Case.

What will happen when a user clicks the command button?

Question51: A company decides that every time an Opportunity is created, they want to create a follow up Task and assign it to the Opportunity Owner.
What should a developer use to implement the requirements?

Question52: What is the correct order of execution for Visualforce Page "get" requests (initial page visit)?

Question53: Which statement is true regarding savepoints?

Question54: A developer has built a multi-page wizard using a single Custom Controller to query and update dat a. Users are complaining that the pages are loading slowly.
What will improve performance? (Choose three.)

Question55: Which type of controller is best suited when you want all of the basic DML functions from an object's normal new/edit page?

Question56: What Visualforce tag can be used to display custom messages in pages using the Salesforce Ul styling for errors, warnings, and other types of messages?

Question57: A developer has a Batch Apex process, Batch_Account_Sales, that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed In the sandbox. However, the developer cannot get code coverage on the Batch Apex class.
The test class is below:

What is causing the code coverage problem?

Question58: A developer is using a third-party JavaScript library to create a custom user interface in Visualforce. The developer needs to use JavaScript to get data from a controller method in response to a user action.
How can the developer accomplish this?

Question59: Within the System.Limit class, what would you call to get the number of calls made in your transaction?

Question60: The Bulk API__________.

Question61: A customer has a single Visualforce page that allows each user to input up to 1500 sales forecasts and instantly view pivoted forecast calculations. Users are complaining that the page is loading slowly, and they are seeing error messages regarding heap and view state limits.
What are three recommendations to optimize page performance? (Choose three.)

Question62: A developer has a test class that creates test data before making a mock call-out, but now receives a you have uncommitted work pending. Please commit or callout before calling out error.
What step should be taken to resolve the error?

Question63: If a developer wanted to display error messages with the standard Salesforce Ul styling, what would they use?

Question64: A developer is integrated with a legacy on-premises SQL database.
What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?

Question65: An Apex trigger and Apex class increment a counter, Edit_Count_c, any time that the Case is changed.

A new process on the case object was just created in production for when a Case is created or updated< since the process was created, they are reports that the Count is being incremented by more than one on Case edit.
Which change in the Apex code will fix the problem?
A)

B)

C)

D)

Question66:
A developer receives complaints that the component loads slowly.
Which change can the developer implement to make the component perform faster?

Question67: Recently a Salesforce org's integration failed because it exceeded the number of allowed API calls in a
24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce. The flow of data is as follows: The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds. If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds. If a match is not found, the integration will create a Lead and a Task for that newly created Lead. What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24-hour period?

Question68: An org contains two custom objects; Building__c and Office__c. Office__c has a Lookup field to Building__c.
A developer is asked to automatically populate the Number_of_Offices__c field on the Building__c object with the count of related Office__c records anytime an Office__c record s created or deleted. The developer cannot modify the field types.
Which solution meets the requirements?

Question69: A company uses Opportunism to track sales to their customers and their org has millions of Opportunities.
They want to begging to track revenue over time through a related Revenue object.
As part of their initial implementation, they want to perform a one-time seeding of their data by automatically creating and populating Revenue records for Opportunities, based on complex logic. They estimate that roughly 100,000 Opportunities will have revenue records and populated.
What is the optimal way to automate this?

Question70: A developer receives a LimitException: Too many query rows: 50001 error when running code.
What debugging approach using the Developer Console provides the fastest and most accurate mechanism to identify a specific component that may be returning an unexpected number of rows?

Question71: Business rules require a Contact to always be created when a new Account is created. What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?

Question72: A company accepts orders for customers in their enterprise resource planning (ERP) crder__c records with a lookup field to Account. The Account object has an External ID field, ERP_Customer_ID__c.
What should the integration use to create new Order__c records that will automatically be related to the correct Account?

Question73: A company uses a custom-built enterprise resource planning (ERP) system to handle order management. The company wants Sales Reps to know the status of orders so that if a customer calls to ask about their shipment, the Sales Rep can advise the customer about the order's status and tracking number if it is already shipped.
Which two methods can make this ERP order data visible in Salesforce? Choose 2 answers

Question74: A developer needs to send Account records to an external system for backup purposes. The process must take a snapshot of Accounts as they are saved and then make a callout to a RESTful web service. The web service can only receive, at most, one record per call. Which feature should be used to implement these requirements?

Question75: A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of ail the test data that is needed to perform the tests.
What should the developer do to speed up test execution?

Question76: Which are relevant practices while analyzing the timeline of different types of transactions in the execution overview panel? (Choose two.)

Question77: An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class. How can the developer generate the code coverage?

Question78: The progress of an apex job queued is using the System.enqueueJob method and needs to be monitored.
Which options are valid? (Choose two.)

Question79: A customer requires that when the billing address field on an Account gets updated, the address field on all its related contact records should reflect the same update.
How can this requirement be met with minimal customizations?

Question80: A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail. What is the optimal way for a developer to fix the issue?

Question81: A company represents their customers as Accounts that have an External ID field called Customer_Number__c. They have a custom Order (Order__c) object, with a Lookup to Account, to represent Orders that are placed in their external order management system (OMS). When an order is fulfilled in the OMS, a REST call to Salesforce should be made that creates an Order record in Salesforce and retates it to the proper Account. What is the optimal way to implement this?

Question82: What is the transaction limit for the number of records for SOQL queries?

Question83: A company manages information about their product offerings in custom objects named Catalog and Catalog Item. Catalog Item has a master-detail field to Catalog, and each Catalog may have as many as 100,000 Catalog Items.
Both custom objects have a CurrencylsoCode Text field that contains the currency code they should use. If a Catalog's CurrencylsoCode changes, all of its Catalog Items' CurrencylsoCodes should be changed as well.
What should a developer use to update the CurrencylsoCodes on the Catalog Items when the Catalog's CurrencylsoCode changes^5

Question84: A developer receives the exception 'SOQL query not selective enough' when performing a query on an object with a large amount of dat a. Which step should be taken to resolve the issue?

Question85:
What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?
A)

B)

C)

D)

Question86: A company has a web page that needs to get Account record information, given its Salesforce record ID, from JavaScript on the page and then display it. Which method of integration is optimal?

Question87: A developer is building a Visualforce page that interacts with external services.
Which interface should the developer implement to test this functionality? (Choose two.)

Question88: Salesforce users consistently receive a "Maximum trigger depth exceeded" error when saving m Account.
How can a developer fix this error?

Question89: Given the following containment hierarchy:

What is the correct way to communicate the new value of a property named ''passthrough'' to my-parent component if the property is defined within my-child-component?
A)

B)

C)

D)

Question90: Consider the controller code above that is called from a Lightning component and returns data wrapped in a class.

Consider the controller code above that is called from a Lightning component and returns data wrapped in a class.
The developer verified that the Queries return a single record each and there is error handing in the Lightning component, but the component is not getting anything back when calling the controller getSomeData().
What is wrong?

Question91: Which code statement includes an Apex method named updateAccount in the class AccountController for use in a Lightning web component?

Question92: How can the DISTANCE and GEOLOCATION functions be used i|n SOQL queries? (Choose two.)

Question93: if the "PageReference.setRedirect" Apex function is set to False, what type of request is made?

Question94: Which use case is an appropriate fit for the future asynchronous Apex method? (Choose two.)

Question95: A company has a custom component that allows users to search for records of a certain object type by invoking an Apex Controller that returns a list of results based on the user's input, when the search Is completed, a searchComplete event is fired, with the results put in a results attribute of the event. The component is designed to be used within other components and may appear on a single page more than once.
What is the optimal code that should be added to fire the event when the search has completed?

Question96: There are user complaints about slow render times of a custom data table within a visualforce page that loads thousands of Account records at once.
What can a developer do to help alleviate such issues?

Question97: A developer has generated Apex code from a WSDL for an external web service. The web service requires Basic authentication.
What code should the developer use to authenticate?

Question98: A developer wrote an Apex class to make several callouts to an external system.
If the URLs used in these callouts will change often, which feature should the developer use to minimize changes needed to the Apex class?

Question99: An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed end Won.
This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.
When a test batch of records are loaded, the Apex trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.
What is the most extendable way to update the Apex trigger to accomplish this?

Question100: Which type of controller is best suited when you want to add custom functionality to a standard controller page, or when you want reusable functionality throughout pages?

Question101: Consider the code above.

When a user dicks on the Link of a Contact's name, what happens'

Question102: A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and SP3 (created in order), before the final execution of the process.
During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls a roll back to SP3 to continue with final execution. However, when the roll, back to SP3 is called, a runtime error occurs.
Why does the developer receive a runtime error?

Question103: A developer wants to write a generic Apex method that will compare the Salesforce Name filed between any two object records, for example to compare the Name field of an Account and an Opportunity; or the name of an Account and a Contact.
How should the developer do this?

Question104: The Salesforce instance at Universal Containers currently integrates with a third-party company to validate mailing addresses via REST services. The third-party address verification system recently changed endpoint URLs for all their set vices from https://th-addreaa-service.3pc.com to https://plc1-mailsarvice.3pc.com.
Everything else remained the same. The developer updated code to reflect this endpoint change, but the mailing address validation service stopped working after the change.
What else should be done to complete this web service end point change?

Question105: A developer has been asked to create code that will meet the following requirements:
Receives input of: Map<ld, Project_c), List<Account>
Performs a potentially long-running callout to an outside web service
Provides a way to confirm that the process executed successfully
Which asynchronous feature should be used?

Question106: A company has a Request__c object that has a lookup to the Opportunity object and a custom field. Status__c, with values of Open,' Closed, and Invalid.' An Opportunity should not be allowed to be deleted if there are any Request__c records related to it that have a Status__c value of Open or 'Closed.' what is the optimal way to enforce the requirement to prevent deletion?

Question107:
What can be done to improve the performance of the insert trigger shown above?

Question108: <lightning: layout multipleRows="true"> <lightning: layoutItem size="12">{!v.account.Name} </flighting:
layoutitem> <lightning:layoutitem 3ize="12">{!v. account .AccountNumber} </lighting: layoutitem>
<lightning: layoutitem size="12">{!v.account. Industry} </lighting: layoutitem> </lightning: layout> Refer to the component code above. The information displays as expected (in three rows) on a mobile device.
However, the information is not displaying as desired (in a single row) on a desktop or tablet. Which option has the correct component changes to display correctly on desktops and tablets?

Question109: A developer creates an application event that has triggered an infinite loop. What may have caused this problem?

Question110: Line 1 public class AttributeTypes Line 2 { Line 3 private final String[] arrayItems; Line 4 Line 5
@AuraEnabled Line 6 public List<String> getStringArray() { Line 7 Strings+ arrayItems = new String*+,
'red', 'green', 'blue' -; Line 8 return arrayItems; Line 9 } Line 10 } Consider the Apex controller above that is called from a Lightning Aura Component. What is wrong with it?

Question111: What is a benefit of JavaScript remoting over Visualforce Remote Objects?

Question112: What is the transaction limit for the number of records for SOSL?